package com.example.designmodel;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class DesignModelActivity extends AppCompatActivity {

    public static void launch(Context context) {
        Intent intent = new Intent(context, DesignModelActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_design_model);

    }

    //策略
    public void onStrategyClick(View view){
        StrategyActivity.launch(DesignModelActivity.this);
    }

    //工厂
    public void onFactoryClick(View view){
        FactoryActivity.launch(DesignModelActivity.this);
    }

    //装饰
    public void onDecoratorClick(View view){
        DecoratorActivity.launch(DesignModelActivity.this);
    }

    //模版
    public void onTemplateClick(View view){
        TemplateActivity.launch(DesignModelActivity.this);
    }

    //责任连
    public void onResponsibility(View view){
        ResponsebilityActivity.launch(DesignModelActivity.this);
    }

    //门面 外观
    public void onFacade(View view){
        FacadeActivity.launch(DesignModelActivity.this);
    }

    //状态
    public void onStatus(View view){
        StatusActivity.launch(DesignModelActivity.this);
    }

    //建造者模式
    public void onBuilder(View view){
        BuilderActivity.launch(DesignModelActivity.this);
    }

    //代理模式
    public void onProxy(View view){
        ProxyActivity.launch(DesignModelActivity.this);
    }

    //原型模式
    public void onProtoType(View view){
        ProtoTypeActivity.launch(DesignModelActivity.this);
    }

}
